/**
 * 
 */
;
layui.define(['form', 'layer'], function(exports) {
	var $ = layui.$;
	var layer = layui.layer;
	var actionajax = {
		/**
		 * 弹出动态，后关闭
		 * @param  {[type]} url      [description]
		 * @param  {[type]} formdata [description]
		 * @return {[type]}          [description]
		 */
		action: function(url, formdata) {
			var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
			$.post(url, formdata,
				function(data) {
					if (data.code == 1) {
						layer.alert(data.msg, {
							skin: 'layui-layer-molv' //样式类名
								,
							closeBtn: 0
						}, function() {
							parent.layer.close(index);
						});
					} else {
						layer.msg(data.msg);
					}
				});
		},

		hello: function(str) {
			alert('Hello' + str);
		}
	};

	exports('admin', actionajax);
});